﻿#region summary
// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.
#endregion

using NSQL.Expressions;

namespace NSQL.Extensions
{
    public static class StringExtensions
    {
        public static string ToCamelCase(this string self)
        {
            if (string.IsNullOrWhiteSpace(self) || char.IsLower(self[0])) return self;
            return char.ToLower(self[0]) + self.Substring(1);
        }
        public static string ToPascalCase(this string self)
        {
            if (string.IsNullOrWhiteSpace(self) || char.IsUpper(self[0])) return self;
            return char.ToUpper(self[0]) + self.Substring(1);
        }

        public static TableSource AsTableSource(this string self, string schema = null)
        {
            return new TableSource(self, schema);
        }
        public static ColumnExpression AsColumn(this string self) => self;
    }
}